﻿using FluentNHibernate.Mapping;

namespace TaskKernel.Domain.Nhibernate.Mappings
{
    public class AbstractTaskHistoryEntryMap : ClassMap<AbstractTaskHistoryEntry>
    {
        public AbstractTaskHistoryEntryMap()
        {
            Table("task_Comments");
            Id(x => x.UID, "GID").GeneratedBy.GuidNative();
            Map(x => x.DateCreate).Column("Date");
            Map(x => x.TaskHistoryEntryType, "Type").CustomType<int>().ReadOnly();
            DiscriminateSubClassesOnColumn("Type");
            References(x => x.Owner, "AccountGID");
            References(x => x.Task).Column("TaskGID");
        }
    }
}